// Town 0: The Temple of the Goddess
begintownscript;

variables;

short choice,wash,pure,dummy,i;

body;

beginstate INIT_STATE;
set_name(6,"Hss-Fass");
set_name(7,"Sss-Tss");
set_name(8,"Hss-Chalss");
set_char_dialogue_pic(8,531,0);
set_name(9,"Hss-Pothss");
set_name(12,"Kass");
set_char_dialogue_pic(12,533,0);
set_name(13,"Purifying slith");
set_name(14,"Thess-Fss");
set_name(18,"Head cook");
set_name(23,"Ethass");
set_char_dialogue_pic(23,534,0);
set_name(27,"Jostoss");
set_name(32,"Gatekeeper");
set_name(34,"Tekoss");
set_name(36,"Slith priest");
set_crime_tolerance(2);
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
// This is where text bubbles go
break;

beginstate 10;
	if (get_flag(0,7) == 1)
	end();
	else
	{message_dialog("This is it, the Temple of the Goddess. Legare's followers built this temple in a single month, an act that is a minor miracle in itself. It shows few signs of its hasty construction so far." , "Everything in here is immaculate, pristine. You wipe your boots off before coming in, but you feel as though you shouldn't even breathe on the furnishings. A sign on the altar in front of you says, _Please respect before continuing._");
	set_flag(0,7,1); }
break; 

beginstate 11;
if (get_flag(0,0) < 1)
{block_entry(1);
	message_dialog("You approach the doors, but the guards block your way.","_You must pay respect to the Goddess at the altar first,_ one of them tells you."); }
if ((get_flag(0,0) == 1) && (get_flag(0,1) < 1)) 
	{message_dialog("The guards nod to you, since they saw that you knelt at the altar. _You are welcome here, in the Temple of the Goddess,_ one says.","");
	set_flag(0,1,1); }
break;

beginstate 12;
if (get_flag(0,0) < 1)
	{reset_dialog();
	add_dialog_str(0,"You stand before the altar. You feel the urge to kneel and pay your respects to the unknown goddess for whom this temple was built. What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Kneel and pray.");
	if (run_dialog(1) == 2)
		{message_dialog("You kneel at the altar and offer a humble prayer to the Goddess." , "Nothing happens.");
		set_flag(0,0,1);
		}
	}
break;

beginstate 13;
if ((get_flag(0,2) < 1) && (get_flag(250,0) < 4))
	{message_dialog("You look around and you can hardly believe your eyes. The sliths built this in a month? This room alone must've taken them half that time. Everything is still immaculately, beautifully maintained." , "The sliths look at you suspiciously. You are not of their kind, and they don't know what non-sliths would be doing here. Apparently Legare's request for your presence is not common knowledge.");
	set_flag(0,2,1);
end(); }
if ((get_flag(0,2) < 1) && (get_flag(250,0) == 4))
	{message_dialog("You look around and you can hardly believe your eyes. The sliths built this in a month? This room alone must've taken them half that time. Everything is still immaculately, beautifully maintained." , "The sliths pass you by without a second glance. Apparently so many new sliths come through here all the time that more are not noticed.");
	set_flag(0,2,1);
end(); }
if ((get_flag(0,2) < 1) && (get_flag(250,0) > 4))
	{message_dialog("You look around and you can hardly believe your eyes. The sliths built this in a month? This room alone must've taken them half that time. Everything is still immaculately, beautifully maintained." , "The sliths give you some strange glances. They don't know what non-sliths would be doing here, but since a slith is with you, they leave you alone. Still, apparently Legare's request for your presence is not common knowledge.");
	set_flag(0,2,1); }
break;

beginstate 14;
if (get_flag(0,3) < 1)
	{message_dialog("You enter Legare's room and look around. The room is expansive and lavish, but almost disappointingly so: given his nearly godlike status among his followers, Legare could've asked for something much more luxurious." , "Still, it is privileged above the rest of his followers. Their quarters are smaller and shabbier.");
	set_flag(0,3,1); }
break;

beginstate 15;
	message_dialog("This book is entitled, _The Teachings of the Goddess._ It is handwritten, presumably by Legare. It is open to a page with a poem on it called _The Forgetting._","");

	reset_dialog();
	add_dialog_str(0,"The Forgetting",0);
	add_dialog_str(1,"From hate, with hate, in hate, his power came;",0);
	add_dialog_str(2,"Mad slith, Sss-Thsss, corrupter, killer foul,",0);
	add_dialog_str(3,"Made worship to a demon lord and king",0);
	add_dialog_str(4,"Whose darkened blackened deeds, like ash from fire",0);
	add_dialog_str(5,"Immense when wind does blow, befouled all",0);
	run_dialog(1);
	
	reset_dialog();
	add_dialog_str(0,"Before, beyond, above, beneath, behind,",0);
	add_dialog_str(1,"Around his presence mighty and most vile;",0);
	add_dialog_str(2,"Such blasphemous belief did give Thsss strength",0);
	add_dialog_str(3,"To proselytize among slithzerikai,",0);
	add_dialog_str(4,"Who had always before been faithful, true --",0);
	add_dialog_str(5,"To blind them to their loyalty most due",0);
	run_dialog(1);
	
	reset_dialog();
	add_dialog_str(0,"Their gods, who in their kindness infinite",0);
	add_dialog_str(1,"Had given them a paradise beyond",0);
	add_dialog_str(2,"Delineation, numeration...",0);
	add_dialog_str(3,"And so the Darklings gathered to make war,",0);
	add_dialog_str(4,"Forget their duties in exchange for blood.",0);
	run_dialog(1);

break;

beginstate 16;
if (get_flag(0,4) == 1)
	end();
	else 
	{reset_dialog();
	add_dialog_str(0,"The sign says, _Wash your hands, please._ What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Wash your hands.");
	if (run_dialog(1) == 2)
		set_flag(0,4,1); }
break;

beginstate 17;
	reset_dialog();
	add_dialog_str(0,"The sign on the pool says, _Wet hands. Apply lightly to arms, shoulders and legs._ The water has a faint acrid smell to it. What do you do?",0);
	add_dialog_choice(0,"Leave.");
	add_dialog_choice(1,"Wash yourself with the liquid.");
	choice = run_dialog(1);
	if ((choice == 2) && (get_flag(0,5) == 1))
		{message_dialog("You follow the sign's directions again. The acid burns again. It feels even worse this time.","");
		set_char_status(1000,12,100,0,0);
		end(); }
	if (choice == 2)
		{message_dialog("You follow the sign's directions. The water burns! It eats away at your skin, but, following Kass's instructions, you ignore the pain. You clear your mind and continue washing." , "Eventually, you finish. You're not sure if you're more pure, but your body is covered in acid now.");
		set_flag(0,5,1);
		set_char_status(1000,12,100,0,0); }
break;

beginstate 18;
if (get_flag(0,6) == 1)
	end();
	else
	{message_dialog("You finally find some evidence of how this temple maintains itself. This is a giant kitchen to feed all the travelers who come through here. Several sliths are hard at work here.","The smell of cooked fish fills the entire room. It would make your mouth water if it weren't quite so strong.");
	set_flag(0,6,1); }
break;


beginstate 19;
if (get_flag(0,8) == 1)
	end();
	else
	{message_dialog("Every large community of sentient beings produces some trash, and this is the place where the Temple disposes of its trash." , "You can see a huge pit at the other side of the cave. That's where the garbage eventually goes.");
	set_flag(0,8,1); }
break;

beginstate 20;
if (get_flag(0,10) == 1)
	end();
	else
	{message_dialog("You enter the library of the temple. It is clearly the most recent thing built, and the wood stain still smells faintly on the bookshelves." , "The library is small compared to the center of learning at which you had been staying, Patrick's Tower, but it is an impressive collection for a month's work.");
	set_flag(0,10,1); }
break;

beginstate 21;
if (get_flag(0,11) == 1)
	end();
	else
	{message_dialog("Apparently the Temple of the Goddess is not finished. The floor here abruptly runs out, and after a small step down, you are on plain cave floor. You see several sliths moving around across this clearing, preparing materials for further construction." , "It appears that they are constructing a garrison. How odd. This area is not populated by many dangerous monsters. You found remnants of a cave giant settlement on your way here, but it was long-deserted.");
	set_flag(0,11,1); }
break;

beginstate 22;
if (get_flag(0,12) == 1)
	end();
	else
	{message_dialog("Over on this side of the cave, there are four bonfires burning brightly. They give heat for the entire cave. Sliths cannot regulate their body heat as well as humans, so they need warm conditions in order to work." , "One slith sits near the fire, occasionally feeding it as necessary.");
	set_flag(0,12,1); }
break;

beginstate 23;
	message_dialog("There is a slith praying here. You don't disturb him.","");
	block_entry(1);
break;

beginstate 24;
if (get_flag(0,13) == 1)
	end();
	else
	{message_dialog("This is a simple prayer room." , "");
	set_flag(0,13,1); }
break;

beginstate 25;
if (get_flag(0,14) == 1)
	end();
	else
	{message_dialog("These seem to be the sleeping quarters for travelers on their way to Bahssikava. They are spartan, to say the least." , "Judging by how worn in the beds are and how new they must be, a lot of sliths have come through here recently.");
	set_flag(0,14,1); }
break;

beginstate 26;
if (get_flag(0,15) == 1)
	end();
	else
	{message_dialog("Evidently Legare is not perfect, nor are his architects. The north wall of this room has caved in. Sliths are hard at work trying to repair it." , "All the beds are shoved to the corner until the room is usable again.");
	set_flag(0,15,1); }
break;

beginstate 27;
	message_dialog("The gatekeeper sees you trying to fiddle with the gate control mechanism. _Don't touch that!_ he says.","");
break;

beginstate 28;
	message_dialog("This is the Temple's treasury. As you look at it, the guards nearby grip their spears tightly. If you open these boxes, you will be in serious trouble.","You wisely don't touch them.");
break;

beginstate 29;
if (get_flag(0,20) == 1)
	end();
	else
	{message_dialog("These shelves sit empty. The library must have more books that have not been shelved yet or must be expecting new books to arrive.","");
	set_flag(0,20,1); }
break;